let fileData = [
  {
    id: 1,
    name: '测试文件名称',
    size: 40000,
    type: '图片',
    status: 1,
    hash: '0xed11048637ab38896010438066585dc795b05e175813a60de6ea9977201a22f2',
    create: {
      id: 1,
      txHash: '0xed11048637ab38896010438066585dc795b05e175813a60de6ea9977201a22f2',
      blockTime: 1111111111111,
      blockNumber: 100000,
      status: 1,
    },
  },
  {
    id: 2,
    name: '测试文件名称',
    size: 40000,
    type: '图片',
    status: 1,
    hash: '0xed11048637ab38896010438066585dc795b05e175813a60de6ea9977201a22f2',
    create: {
      id: 2,
      txHash: '0xed11048637ab38896010438066585dc795b05e175813a60de6ea9977201a22f2',
      blockTime: 1111111111111,
      blockNumber: 100000,
      status: 1,
    },
  },
  {
    id: 3,
    name: '测试文件名称',
    size: 40000,
    type: '图片',
    status: 1,
    hash: '0xed11048637ab38896010438066585dc795b05e175813a60de6ea9977201a22f2',
    create: {
      id: 3,
      txHash: '0xed11048637ab38896010438066585dc795b05e175813a60de6ea9977201a22f2',
      blocTime: 1111111111111,
      status: 1,
    },
  },
];

export default {
  'POST /api/verify': (req, res) => {
    // console.log(req.body);

    let work = fileData.find((item) => {
      return item.hash === req.body.hashValue;
    });

    if (work != null) {
      res.send({
        status: 'ok',
      });
    } else {
      res.send({
        status: 'error',
      });
    }
  },
};
